feat: Add JSONNET_PATH support for cli#616
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for resolving Jsonnet imports via the JSONNET_PATH environment variable in the CLI/runtime, aligning sjsonnet behavior with other Jsonnet implementations and addressing issue #608.
Changes:
- Extend
Configto parseJSONNET_PATHand combine it with--jpath/-Jvalues (including--reverse-jpaths-prioritybehavior for-Jonly). - Thread an optional
jsonnetPathEnvoverride intoSjsonnetMainBase.main0for testability and wire it into importer search roots. - Add JVM and JVM-native tests covering
JSONNET_PATHparsing and precedence vs-J.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sjsonnet/test/src-jvm/sjsonnet/MainTests.scala | Adds integration tests for JSONNET_PATH import resolution and introduces an env-injecting test helper. |
| sjsonnet/test/src-jvm/sjsonnet/Example.java | Updates Java example invocation to match the new main0 signature. |
| sjsonnet/test/src-jvm-native/sjsonnet/ConfigTests.scala | Adds unit tests for JSONNET_PATH parsing and combined jpath ordering logic. |
| sjsonnet/src-jvm-native/sjsonnet/SjsonnetMainBase.scala | Adds jsonnetPathEnv plumbing and updates CLI/help text handling. |
| sjsonnet/src-jvm-native/sjsonnet/Config.scala | Implements JSONNET_PATH parsing and merges it into ordered import search paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @He-Pin just want to clarify: are you asking me to test this branch before you merge this PR or was it more an open invitation? If it's the former: I can do that, but I know nothing of Scala or how to build the native binary. I also could not find any repo docs on how to create a build. I just used Thank you for working on this and quick response! 🙏🏾. |
refs: #608
@tmeijn would you like to test this locally?